package com.mars.module.admin.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 租房记录对象 sys_house_rent_record
 *
 * @author mars
 * @date 2024-01-23
 */

@Data
@ApiModel(value = "租房记录对象")
@Accessors(chain = true)
@TableName("sys_house_rent_record")
public class SysHouseRentRecord {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "id")
    private Long id;
    /**
     * 房屋编号
     */
    @Excel(name = "房屋编号")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "房屋编号")
    private Long houseId;

    @TableField(exist = false)
    @Excel(name = "房屋名称")
    @ApiModelProperty(value = "房屋名称")
    private String houseName;
    /**
     * 用户ID
     */
    @Excel(name = "用户ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @TableField(exist = false)
    @Excel(name = "用户姓名")
    @ApiModelProperty(value = "用户姓名")
    private String userName;

    /**
     * 租赁开始日期
     */
    @Excel(name = "租赁开始日期")
    @ApiModelProperty(value = "租赁开始日期")
    private LocalDate startDate;
    /**
     * 租赁结束日期
     */
    @Excel(name = "租赁结束日期")
    @ApiModelProperty(value = "租赁结束日期")
    private LocalDate endDate;
    /**
     * 状态：1-审核通过 0-未通过
     */
    @Excel(name = "状态：1-审核通过 0-未通过")
    @ApiModelProperty(value = "状态：1-审核通过 0-未通过")
    private String status;

    @TableField(exist = false)
    @ApiModelProperty(value = "状态")
    private String statusName;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, value = "create_time")
    private LocalDateTime createTime;
}
